package collections.predecessor;

import java.util.*;

/**
 * @Classname SynList
 * @Description TODO
 * @Date 2025/1/8 23:53
 * @Author zhuzhenguo
 */
public class SynList {

    public static void main(String[] args) {
        // 使用的是同步代码块的方式，从性能上来讲也没什么提高
        List<Integer> list = Collections.synchronizedList(new ArrayList<Integer>());
        list.add(5);
        System.out.println(list.get(0));

        Map<Object, Object> objectObjectMap = Collections.synchronizedMap(new HashMap<>());
    }

}
